        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>ContactConstraint class / box2d_console Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d_console" data-type="ContactConstraint">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d_console.html">box2d_console</a> &rsaquo; <a href="../box2d_console/ContactConstraint.html">ContactConstraint</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>ContactConstraint</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class ContactConstraint {
  List&lt;ContactConstraintPoint&gt; points;

  final Vector localNormal;
  final Vector localPoint;
  final Vector normal;

  final Matrix22 normalMass;
  //TODO(gregbglw): What does K mean? Find out and change the name.
  final Matrix22 K;

  Body bodyA;
  Body bodyB;

  int type;

  num radius;
  num friction;
  num restitution;
  int pointCount;

  Manifold manifold;

  ContactConstraint() :
    points = new List&lt;ContactConstraintPoint&gt;(Settings.MAX_MANIFOLD_POINTS),
    pointCount = 0,
    manifold = null,
    localNormal = new Vector(),
    localPoint = new Vector(),
    normal = new Vector(),
    normalMass = new Matrix22(),
    K = new Matrix22() {
    for (int i = 0; i &lt; Settings.MAX_MANIFOLD_POINTS; i++) {
        points[i] = new ContactConstraintPoint();
    }
  }

  void setFrom(ContactConstraint cp) {
    pointCount = cp.pointCount;
    localNormal.setFrom(cp.localNormal);
    localPoint.setFrom(cp.localPoint);
    normal.setFrom(cp.normal);
    normalMass.setFrom(cp.normalMass);
    K.setFrom(cp.K);
    bodyA = cp.bodyA;
    bodyB = cp.bodyB;
    type = cp.type;
    radius = cp.radius;
    friction = cp.friction;
    restitution = cp.restitution;
    manifold = cp.manifold;
    for(int i=0; i&lt;cp.pointCount; i++) {
      points[i].setFrom(cp.points[i]);
    }
  }

  String toString() {
    String result = 'localNormal: "$localNormal", localPoint: "$localPoint" '
        'normal: "$normal", radius: "$radius" friction: "$friction" '
        'restitution: "$restitution", pointCount: "$pointCount"';
    return result;
  }
}
</pre>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="ContactConstraint">
<button class="show-code">Code</button>
new <strong>ContactConstraint</strong>() <a class="anchor-link" href="#ContactConstraint"
              title="Permalink to ContactConstraint.ContactConstraint">#</a></h4>
<div class="doc">
<pre class="source">
ContactConstraint() :
  points = new List&lt;ContactConstraintPoint&gt;(Settings.MAX_MANIFOLD_POINTS),
  pointCount = 0,
  manifold = null,
  localNormal = new Vector(),
  localPoint = new Vector(),
  normal = new Vector(),
  normalMass = new Matrix22(),
  K = new Matrix22() {
  for (int i = 0; i &lt; Settings.MAX_MANIFOLD_POINTS; i++) {
      points[i] = new ContactConstraintPoint();
  }
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="bodyA">
<button class="show-code">Code</button>
<a href="../box2d_console/Body.html">Body</a>         <strong>bodyA</strong> <a class="anchor-link"
            href="#bodyA"
            title="Permalink to ContactConstraint.bodyA">#</a>
        </h4>
        <div class="doc">
<pre class="source">
Body bodyA;
</pre>
</div>
</div>
<div class="field"><h4 id="bodyB">
<button class="show-code">Code</button>
<a href="../box2d_console/Body.html">Body</a>         <strong>bodyB</strong> <a class="anchor-link"
            href="#bodyB"
            title="Permalink to ContactConstraint.bodyB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
Body bodyB;
</pre>
</div>
</div>
<div class="field"><h4 id="friction">
<button class="show-code">Code</button>
num         <strong>friction</strong> <a class="anchor-link"
            href="#friction"
            title="Permalink to ContactConstraint.friction">#</a>
        </h4>
        <div class="doc">
<pre class="source">
num friction;
</pre>
</div>
</div>
<div class="field"><h4 id="K">
<button class="show-code">Code</button>
final <a href="../box2d_console/Matrix22.html">Matrix22</a>         <strong>K</strong> <a class="anchor-link"
            href="#K"
            title="Permalink to ContactConstraint.K">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Matrix22 K;
</pre>
</div>
</div>
<div class="field"><h4 id="localNormal">
<button class="show-code">Code</button>
final <a href="../box2d_console/Vector.html">Vector</a>         <strong>localNormal</strong> <a class="anchor-link"
            href="#localNormal"
            title="Permalink to ContactConstraint.localNormal">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Vector localNormal;
</pre>
</div>
</div>
<div class="field"><h4 id="localPoint">
<button class="show-code">Code</button>
final <a href="../box2d_console/Vector.html">Vector</a>         <strong>localPoint</strong> <a class="anchor-link"
            href="#localPoint"
            title="Permalink to ContactConstraint.localPoint">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Vector localPoint;
</pre>
</div>
</div>
<div class="field"><h4 id="manifold">
<button class="show-code">Code</button>
<a href="../box2d_console/Manifold.html">Manifold</a>         <strong>manifold</strong> <a class="anchor-link"
            href="#manifold"
            title="Permalink to ContactConstraint.manifold">#</a>
        </h4>
        <div class="doc">
<pre class="source">
Manifold manifold;
</pre>
</div>
</div>
<div class="field"><h4 id="normal">
<button class="show-code">Code</button>
final <a href="../box2d_console/Vector.html">Vector</a>         <strong>normal</strong> <a class="anchor-link"
            href="#normal"
            title="Permalink to ContactConstraint.normal">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Vector normal;
</pre>
</div>
</div>
<div class="field"><h4 id="normalMass">
<button class="show-code">Code</button>
final <a href="../box2d_console/Matrix22.html">Matrix22</a>         <strong>normalMass</strong> <a class="anchor-link"
            href="#normalMass"
            title="Permalink to ContactConstraint.normalMass">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Matrix22 normalMass;
</pre>
</div>
</div>
<div class="field"><h4 id="pointCount">
<button class="show-code">Code</button>
int         <strong>pointCount</strong> <a class="anchor-link"
            href="#pointCount"
            title="Permalink to ContactConstraint.pointCount">#</a>
        </h4>
        <div class="doc">
<pre class="source">
int pointCount;
</pre>
</div>
</div>
<div class="field"><h4 id="points">
<button class="show-code">Code</button>
List&lt;<a href="../box2d_console/ContactConstraintPoint.html">ContactConstraintPoint</a>&gt;         <strong>points</strong> <a class="anchor-link"
            href="#points"
            title="Permalink to ContactConstraint.points">#</a>
        </h4>
        <div class="doc">
<pre class="source">
List&lt;ContactConstraintPoint&gt; points;
</pre>
</div>
</div>
<div class="field"><h4 id="radius">
<button class="show-code">Code</button>
num         <strong>radius</strong> <a class="anchor-link"
            href="#radius"
            title="Permalink to ContactConstraint.radius">#</a>
        </h4>
        <div class="doc">
<pre class="source">
num radius;
</pre>
</div>
</div>
<div class="field"><h4 id="restitution">
<button class="show-code">Code</button>
num         <strong>restitution</strong> <a class="anchor-link"
            href="#restitution"
            title="Permalink to ContactConstraint.restitution">#</a>
        </h4>
        <div class="doc">
<pre class="source">
num restitution;
</pre>
</div>
</div>
<div class="field inherited"><h4 id="runtimeType">
<button class="show-code">Code</button>
final Type         <strong>runtimeType</strong> <a class="anchor-link"
            href="#runtimeType"
            title="Permalink to ContactConstraint.runtimeType">#</a>
        </h4>
        <div class="inherited-from">inherited from Object </div><div class="doc">
<p>A representation of the runtime type of the object.</p>
<pre class="source">
external Type get runtimeType;
</pre>
</div>
</div>
<div class="field"><h4 id="type">
<button class="show-code">Code</button>
int         <strong>type</strong> <a class="anchor-link"
            href="#type"
            title="Permalink to ContactConstraint.type">#</a>
        </h4>
        <div class="doc">
<pre class="source">
int type;
</pre>
</div>
</div>
</div>
<div>
<h3>Operators</h3>
<div class="method inherited"><h4 id="==">
<button class="show-code">Code</button>
bool <strong>operator ==</strong>(other) <a class="anchor-link" href="#=="
              title="Permalink to ContactConstraint.operator ==">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>The equality operator.</p>
<p>The default behavior for all <code>Object</code>s is to return true if and
only if <code>this</code> and 
<span class="param">other</span> are the same object.</p>
<p>If a subclass overrides the equality operator it should override
the <code>hashCode</code> method as well to maintain consistency.</p>
<pre class="source">
bool operator ==(other) =&gt; identical(this, other);
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="ContactConstraint">
<button class="show-code">Code</button>
new <strong>ContactConstraint</strong>() <a class="anchor-link" href="#ContactConstraint"
              title="Permalink to ContactConstraint.ContactConstraint">#</a></h4>
<div class="doc">
<pre class="source">
ContactConstraint() :
  points = new List&lt;ContactConstraintPoint&gt;(Settings.MAX_MANIFOLD_POINTS),
  pointCount = 0,
  manifold = null,
  localNormal = new Vector(),
  localPoint = new Vector(),
  normal = new Vector(),
  normalMass = new Matrix22(),
  K = new Matrix22() {
  for (int i = 0; i &lt; Settings.MAX_MANIFOLD_POINTS; i++) {
      points[i] = new ContactConstraintPoint();
  }
}
</pre>
</div>
</div>
<div class="method inherited"><h4 id="hashCode">
<button class="show-code">Code</button>
int <strong>hashCode</strong>() <a class="anchor-link" href="#hashCode"
              title="Permalink to ContactConstraint.hashCode">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>Get a hash code for this object.</p>
<p>All objects have hash codes. Hash codes are guaranteed to be the
same for objects that are equal when compared using the equality
operator <code>==</code>. Other than that there are no guarantees about
the hash codes. They will not be consistent between runs and
there are no distribution guarantees.</p>
<p>If a subclass overrides <code>hashCode</code> it should override the
equality operator as well to maintain consistency.</p>
<pre class="source">
external int hashCode();
</pre>
</div>
</div>
<div class="method inherited"><h4 id="noSuchMethod">
<button class="show-code">Code</button>
<strong>noSuchMethod</strong>(String name, List args) <a class="anchor-link" href="#noSuchMethod"
              title="Permalink to ContactConstraint.noSuchMethod">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p><code>noSuchMethod</code> is invoked when users invoke a non-existant method
on an object. The name of the method and the arguments of the
invocation are passed to <code>noSuchMethod</code>. If <code>noSuchMethod</code>
returns a value, that value becomes the result of the original
invocation.</p>
<p>The default behavior of <code>noSuchMethod</code> is to throw a
<code>noSuchMethodError</code>.</p>
<pre class="source">
external Dynamic noSuchMethod(String name, List args);
</pre>
</div>
</div>
<div class="method inherited"><h4 id="Object">
<button class="show-code">Code</button>
const <strong>Object</strong>() <a class="anchor-link" href="#Object"
              title="Permalink to ContactConstraint.Object">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>Creates a new <code>Object</code> instance.</p>
<p><code>Object</code> instances have no meaningful state, and are only useful
through their identity. An <code>Object</code> instance is equal to itself
only.</p>
<pre class="source">
const Object();
</pre>
</div>
</div>
<div class="method"><h4 id="setFrom">
<button class="show-code">Code</button>
void <strong>setFrom</strong>(<a href="../box2d_console/ContactConstraint.html">ContactConstraint</a> cp) <a class="anchor-link" href="#setFrom"
              title="Permalink to ContactConstraint.setFrom">#</a></h4>
<div class="doc">
<pre class="source">
void setFrom(ContactConstraint cp) {
  pointCount = cp.pointCount;
  localNormal.setFrom(cp.localNormal);
  localPoint.setFrom(cp.localPoint);
  normal.setFrom(cp.normal);
  normalMass.setFrom(cp.normalMass);
  K.setFrom(cp.K);
  bodyA = cp.bodyA;
  bodyB = cp.bodyB;
  type = cp.type;
  radius = cp.radius;
  friction = cp.friction;
  restitution = cp.restitution;
  manifold = cp.manifold;
  for(int i=0; i&lt;cp.pointCount; i++) {
    points[i].setFrom(cp.points[i]);
  }
}
</pre>
</div>
</div>
<div class="method"><h4 id="toString">
<button class="show-code">Code</button>
String <strong>toString</strong>() <a class="anchor-link" href="#toString"
              title="Permalink to ContactConstraint.toString">#</a></h4>
<div class="doc">
<div class="inherited">
<p>Returns a string representation of this object.</p>
<div class="docs-inherited-from">docs inherited from Object </div></div>
<pre class="source">
String toString() {
  String result = 'localNormal: "$localNormal", localPoint: "$localPoint" '
      'normal: "$normal", radius: "$radius" friction: "$friction" '
      'restitution: "$restitution", pointCount: "$pointCount"';
  return result;
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
